import { defineStore } from "pinia";
import { computed, ref } from "vue";
const useCountStore = defineStore('count', () => {
  const count = ref(10)
  const addCount = () => {
    count.value++
  }
  const result = computed(() => count.value*2)
  const info = ref()
  const setInfo = () => {
    setTimeout(() => {
      info.value = {name: '张学友', age: 50}
    }, 1000)
  }
  return {
    count,
    addCount,
    result,
    info,
    setInfo
  }
})
export default useCountStore